package com.lhkj.ct.base.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

/**
 * 下拉选项对象
 *
 * @author haoxr
 * @since 2022/1/22
 */
@ApiModel(description ="下拉选项对象")
public class Option<T> {

    public Option() {
    }

    public Option(T value, String label) {
        this.value = value;
        this.label = label;
    }

    public Option(T value, String label, List<Option<T>> children) {
        this.value = value;
        this.label = label;
        this.children= children;
    }

    @ApiModelProperty(value="选项的值")
    private T value;

    @ApiModelProperty(value="选项的标签")
    private String label;

    @ApiModelProperty(value="子选项列表")
    @JsonInclude(value = JsonInclude.Include.NON_EMPTY)
    private List<Option<T>> children;

    public T getValue() {
        return value;
    }

    public void setValue(T value) {
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public List<Option<T>> getChildren() {
        return children;
    }

    public void setChildren(List<Option<T>> children) {
        this.children = children;
    }
}
